#!/bin/sh
./WishList-compile;

#SERVER=128.42.142.27;
#PORT=22;
#SERVER=128.42.142.25;
SERVER=199.104.137.24;
PORT=2201;
rm -rf www/me.shep.wishlist.WishList/WEB-INF;
mkdir -p www/me.shep.wishlist.WishList/WEB-INF;
cp web.xml www/me.shep.wishlist.WishList/WEB-INF;
cp -r lib www/me.shep.wishlist.WishList/WEB-INF;
cp ../gwt-servlet.jar www/me.shep.wishlist.WishList/WEB-INF/lib/;
cp -r bin/ www/me.shep.wishlist.WishList/WEB-INF/classes;
rm WishList.war;
cd www/me.shep.wishlist.WishList/;
zip -r ../../WishList.war *;
scp -P$PORT ../../WishList.war root@$SERVER:/usr/share/jetty/webapps;
ssh root@$SERVER -p$PORT '/etc/init.d/jetty restart';
